package com.yunbao.service;

import com.yunbao.dao.ResumeDao;
import com.yunbao.pojo.Resume;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by louisyuu on 2020/3/15 下午4:43
 */

@Service
public class ResumeServiceImpl implements ResumeService {


    @Autowired
    private ResumeDao resumeDao;


    @Override
    public List<Resume> getResumes() {
        return resumeDao.findAll();
    }

    @Override
    public void insert(Resume resume) {
        resumeDao.save(resume);

    }

    @Override
    public void update(Resume resume) {
        if (resume != null && resume.getId() != null) {
            resumeDao.save(resume);
        }
    }

    @Override
    public void delete(Long id) {
        resumeDao.deleteById(id);

    }
}
